﻿using System.Reflection;

namespace Borg
{
    public class ReflectionEventHandler
    {
        internal object extensionObject;
        internal MethodInfo methodInfo;

        public ReflectionEventHandler(object extensionObject, MethodInfo methodInfo)
        {
            this.extensionObject = extensionObject;
            this.methodInfo = methodInfo;
        }

        internal void InvokeMethod(object sender, object args)
        {
            methodInfo.Invoke(extensionObject, new[] { sender, args });
        }
    }
}

